package com.bw.house.controller;

import com.bw.house.service.TbHouseExamineService;
import com.bw.result.ResultVo;
import com.bw.vo.IdVo;
import com.bw.vo.TbHouseExamineSearchVo;
import com.bw.vo.TbHouseExamineVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuzhihao
 * @version 1.0
 * @description: TODO
 * @date 2023/11/12 19:58:30
 */
@RestController
@Slf4j
@RequestMapping("/examine")
public class TbHouseExamineController {

    @Autowired
    private TbHouseExamineService tbHouseExamineService;

    /**
     * @description : //TODO 审核分页列表 (分审核状态、发布与求租求购、房屋类型、省市县)
     * @param tbHouseExamineSearchVo
     * @return : com.bw.result.ResultVo
     * @author : liuzhihao
     * @date : 2023/11/12 20:37:03
     */
    @PostMapping("/listBySearchVo")
    public ResultVo listBySearchVo(@RequestBody TbHouseExamineSearchVo tbHouseExamineSearchVo){
        return tbHouseExamineService.listBySearchVo(tbHouseExamineSearchVo);
    }

    /**
     * @description : //TODO 审核通过/审核不通过
     * @param tbHouseExamineVo
     * @return : com.bw.result.ResultVo
     * @author : liuzhihao
     * @date : 2023/11/13 8:47:46
     */
    @PostMapping("/update")
    public ResultVo update(@RequestBody TbHouseExamineVo tbHouseExamineVo){
        return tbHouseExamineService.updateByVo(tbHouseExamineVo);
    }

    /**
     * @description : //TODO 通过activiti工作流引擎审核
     * @param tbHouseExamineVo
     * @return : com.bw.result.ResultVo
     * @author : liuzhihao
     * @date : 2023/11/15 11:32:56
     */
    @PostMapping("/examineByActiviti")
    public ResultVo examineByActiviti(@RequestBody TbHouseExamineVo tbHouseExamineVo){
        return tbHouseExamineService.examineByActiviti(tbHouseExamineVo);
    }

    /**
     * @description : //TODO 审核房源详情
     * @param idVo
     * @return : com.bw.result.ResultVo
     * @author : liuzhihao
     * @date : 2023/11/13 8:57:12
     */
    @PostMapping("/getExamineHouseDetail")
    public ResultVo getExamineHouseDetail(@RequestBody IdVo idVo){
        return tbHouseExamineService.getExamineHouseDetail(idVo);
    }
}
